package com.wj.base;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

/**
 * @author wen.jie
 * @date 2021/8/5 14:58
 */
public class Read {

    public static Integer[] read(String path){
        ArrayList<Integer> list = new ArrayList<>();
        try(BufferedReader reader = new BufferedReader(new InputStreamReader(Read.class.getClassLoader().getResourceAsStream(path)));){
            String line = null;
            while ((line = reader.readLine())!=null){
                int i = Integer.parseInt(line);
                list.add(i);
            }
            return list.toArray(new Integer[0]);
        }catch (IOException e){

        }
        return null;
    }
}
